<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<%@ include file="/WEB-INF/pages/weixin/include/title.jsp"%>
    <link rel="stylesheet" href="${root}/res/weui/dist/style/weui.css"/>
    <link rel="stylesheet" href="${root}/res/weui/dist/style/weui.ex.css"/>
    <link rel="stylesheet" href="${root}/res/jsLib/weixin/weixin.css"/>
    <script src="${root}/res/weui/dist/js/zepto.min.js"></script>
    <script src="${root}/res/jsLib/weixin/weixin.js"></script>
    <script type="text/javascript">
	    $(function () {
	    	var queryState = '${param.queryState}';
	    	$("#menuName").html(wxUtils.getServiceMenuName(queryState));
	    	var loadList = function(){
	    		$("#serviceList").empty();
	    		$("#moreBtn").attr('pageNo','0').attr('pageCount','1');
		    	wxUtils.loadDataPage({
		    		urlFun:function(pageNo){
		    			return JSON.stringify({"method": queryState,"serviceName":$("#searchInput").val(),"orgId":"${sessionScope.loginUser.orgId}","pageNo": pageNo});
		    		},
		    		showFun:function(data){
		    			$.each(data.datalist,function(index,info){
		    				var url = '/weixin/user/service/content.do?id='+info['ID']+'&queryState='+queryState;
							var a  = $('<a href="javascript:wxUtils.load(\''+url+'\')" class="weui-media-box weui-media-box_appmsg" id="'+info['ID']+'"/>').appendTo($("#serviceList"));
							var hd = $('<div class="weui-media-box__hd"/>').appendTo(a);
							var img = $('<img class="weui-media-box__thumb" src="${root}/res/weui/dist/img/servcie-img.png" alt=""/>').appendTo(hd);
							var bd = $('<div class="weui-media-box__bd"/>').appendTo(a);
							$('<h4 class="weui-media-box__title"/>').appendTo(bd).html(info['SERVICE_NAME']);
							$('<p class="weui-media-box__desc"/>').appendTo(bd).html(info['SERVICE_PROCESS']);
							var ul = $('<ul class="weui-media-box__info_e"/>').appendTo(bd);
							$('<ul class="weui-media-box__info_e"/>').appendTo(bd);
							if(queryState=='tmp_f107'){
								$('<li class="weui-media-box__info__meta"/>').appendTo(ul).html(info['PROVIDE_ENT_NAME']);
								$('<li class="weui-media-box__info__meta"/>').appendTo(ul).html(wxUtils.getServiceStatus(info['SERVICE_STATUS']));
							}else{
								$('<li class="weui-media-box__info__meta"/>').appendTo(ul).html(info['ACCEPT_ENT_NAME']+','+info['ACCEPT_ENT_LINKMAN']+','+info['ACCEPT_ENT_LINKPHONE']);
							}
							$('<li class="weui-media-box__info__meta"/>').appendTo(ul).html(info['APPLY_TIME'].substring(5,10));
						});
		    		}
		    	});
	    	}
	    	loadList();
	    	//搜索服务名称事件
	    	$("#searchInput").blur(function(){
	    		loadList();
	    	});
	    	$("#returnCenterBtn").click(function(){
	    		history.go(-1);
	    	});
	    	wxUtils.initSearchBar();
	    	wxUtils.iniScrollBar();
	    });
	</script>
</head>
<body>

	<div class="page">
		<div class="weui-tab__panel detail_panel">
		
		</div>
	    <div class="weui-tab__panel list_panel">
	    	<div position="top">
		    	<div class="weui-panel__hd" id="returnCenterBtn"> &lt 返回用户中心</div>
				<div class="weui-search-bar weui-navbar" id="searchBar">
				    <form class="weui-search-bar__form">
				        <div class="weui-search-bar__box">
				            <i class="weui-icon-search"></i>
				            <input type="search" class="weui-search-bar__input" id="searchInput" placeholder="搜索" />
				            <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
				        </div>
				        <label for="search_input" class="weui-search-bar__label" id="searchText">
				            <i class="weui-icon-search"></i>
				            <span>搜索</span>
				        </label>
				    </form>
				    <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
				</div>
			    <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
		    </div>
		    <div class="weui-tab__panel">
				<div class="weui-panel weui-panel_access" position="center">
			    <div class="weui-panel__hd" id="menuName">社会服务</div>
			        <div class="weui-panel__bd" id="serviceList">
			       		
				    </div>
				    <jsp:include page="/WEB-INF/pages/weixin/page.jsp"></jsp:include>
				</div>
			</div>
		</div>
		<jsp:include page="/WEB-INF/pages/weixin/bottom.jsp?menu=2"></jsp:include>
	</div>
                        
</body>
</html>

